package com.tf.pemporaryfood.service.serviceImpl;

import com.tf.pemporaryfood.domain.entity.Goods;
import com.tf.pemporaryfood.mapper.GoodsMapper;
import com.tf.pemporaryfood.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> search(String query, Integer cateId, Long start, Integer count) {
//        System.out.println(query + "  " + cateId + "  " + start + "  " + count);
        return goodsMapper.search(query, cateId, start, count);
    }

    @Override
    public Long getTotal(String query, Integer cateId) {
        return goodsMapper.getTotal(query, cateId);
    }

    @Override
    public Goods getInfo(Long goodsId) {

        return goodsMapper.getInfo(goodsId);
    }
}
